public class Arithmetic_Progression {
    final int start;
    final int n;
    final int d;
    int sum;
    int[] arr;

    public Arithmetic_Progression(int start, int n, int d) {
        this.start = start;
        this.n = n;
        this.d = d;
        calculateSum(start, n, d);
    }

    public void calculateSum(int start, int n, int d) {
        arr = new int[n];
        for (int i = 0; i < n; i++) {
            this.sum += arr[i] = start + i * d;
            System.out.print(arr[i] + "\t");
        }
    }
}

class Res {
    public static void main(String[] args) {
        Arithmetic_Progression arithmetic_Progression = new Arithmetic_Progression(1, 20, 2);
        System.out.print("\n∑ = " + arithmetic_Progression.sum);
    }
}
